import fetch from '@/api'


// 查询
export function getAccountList(params) {
    return fetch({
        method: 'get',
        url: '/cargoOwnerAccount',
        params
    })
}


// 新增
export function addAccount(data) {
    return fetch({
        method: 'post',
        url: `/cargoOwnerAccount`,
        data
    })
}

// 编辑
export function updateAccount(id, data) {
    return fetch({
        method: 'put',
        url: `/cargoOwnerAccount/${id}`,
        data,
    })
}


// 根据ID删除账户
export function delAccount(id) {
    return fetch({
        method: 'delete',
        url: `/cargoOwnerAccount/${id}`,
    })
}


// 账户总数
export function getAccountTotal(params) {
    return fetch({
        method: 'get',
        url: '/cargoOwnerAccount/natureStatistics',
        params
    })
}

// 禁止结算
export function disableSettle(data) {
    return fetch({
        method: 'post',
        url: `/cargoOwnerAccount/disableSettle`,
        data
    })
}

// 恢复结算
export function enableSettle(data) {
    return fetch({
        method: 'post',
        url: `/cargoOwnerAccount/enableSettle`,
        data
    })
}

// 开户客户销户
export function toSettlement(data) {
    return fetch({
        method: 'post',
        url: `/cargoOwnerAccount/toSettlement`,
        data
    })
}

// 结算客户开户
export function toOpen(data) {
    return fetch({
        method: 'post',
        url: `/cargoOwnerAccount/toOpen`,
        data
    })
}

